<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
  internals.settings.setEditingBehavior('win');

selection_test(
  '<div contenteditable dir="ltr">|אבצ דעפ    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אבצ דעפ    היח ופק</div>',
  '10-0 left word');

selection_test(
  '<div contenteditable dir="ltr">א|בצ דעפ    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-1 left word');

selection_test(
  '<div contenteditable dir="ltr">אב|צ דעפ    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-2 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ| דעפ    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-3 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ |דעפ    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-4 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ ד|עפ    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 |\u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-5 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דע|פ    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 |\u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-6 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ|    היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 |\u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-7 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ |   היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 |\u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-8 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ  |  היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 |\u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-9 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ   | היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 |\u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-10 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    |היח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 |\u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-11 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    ה|יח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4 |   \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-12 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    הי|ח ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4 |   \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-13 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    היח| ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4 |   \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-14 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    היח |ופק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4 |   \u05D4\u05D9\u05D7 \u05D5\u05E4\u05E7</div>',
  '10-15 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    היח ו|פק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 |\u05D5\u05E4\u05E7</div>',
  '10-16 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    היח ופ|ק</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 |\u05D5\u05E4\u05E7</div>',
  '10-17 left word');

selection_test(
  '<div contenteditable dir="ltr">אבצ דעפ    היח ופק|</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05E6 \u05D3\u05E2\u05E4    \u05D4\u05D9\u05D7 |\u05D5\u05E4\u05E7</div>',
  '10-18 left word');
</script>
